package com.ymk.service.impl;

import com.ymk.base.mybatis.DaoRouter;
import com.ymk.base.mybatis.Pagination;
import com.ymk.bo.rbac.RbacUserRoleBO;
import com.ymk.service.IRbacUserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户-角色 服务实现类
 * </p>
 *
 * @author 莫参商
 * @since 2022-06-02
 */
@Service
public class RbacUserRoleService implements IRbacUserRoleService {

    @Override
    public RbacUserRoleBO get(Map param) {
    return this.daoRouter.queryForObject("RbacUserRole.loadRbacUserRole",param);
    }

    @Override
    public List<RbacUserRoleBO> list(Map param) {
        return this.daoRouter.query("RbacUserRole.loadRbacUserRole",param);
    }

    @Override
    public List<RbacUserRoleBO> listForPage(Pagination pagination) {
        return this.daoRouter.query("RbacUserRole.loadRbacUserRoleForPage",pagination);
    }

    @Override
    public void post(RbacUserRoleBO param) {
        this.daoRouter.insert("ARbacUserRole.insertRbacUserRole",param);
    }

    @Override
    public void update(RbacUserRoleBO param) {
        this.daoRouter.update("ARbacUserRole.updateRbacUserRole",param);
    }

    @Override
    public void del(RbacUserRoleBO param) {
        this.daoRouter.update("ARbacUserRole.delRbacUserRole",param);
    }

    @Autowired
    private DaoRouter daoRouter;

}
